#define F_CPU 8000000UL
#include <util/delay.h>
#include <avr/pgmspace.h>

#define accXmin  270UL
#define accXmax  700UL
#define accYmin  320UL
#define accYmax  680UL
#define accZmin  320UL
#define accZmax  680UL
#define joyXmin  33UL
#define joyXmax  233UL
#define joyYmin  28UL
#define joyYmax  228UL


int8_t joyX;
int8_t joyY;
int16_t accelX;
int16_t accelY;
int16_t accelZ;
uint8_t butC;
uint8_t butZ;

int16_t sensors[6];

void nunchuckInit();
void nunchuckRead();

#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) /* clear bit */
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))  /* set bit */
